if __debug__:
    from SimPy.SimulationTrace import *
else:
    from SimPy.Simulation import *

from random import seed, expovariate, normalvariate, choice
from weather import Weather
from plant import Plant


water = Level(capacity=10000,initialBuffered=300,name='Ground Moisture',unitName='ml')

initialize()
seed(0)
normalvariate(20,10)

for i in range(0,1):
    waterreq = normalvariate(50,10)
    plant = Plant("Plant %d" % i, waterreq, water)
    activate(plant,plant.grow(),at=int(normalvariate(5,2)))

weather = Weather("Weather", normalvariate(6,1), normalvariate(2,1), [water])
activate(weather, weather.rain(),at=0)
#simulate(until=1000,rel_speed=1,real_time=True)
simulate(until=1000)
print 'Current time is ',now()
